using System;
using System.Globalization;
using System.Windows.Data;
using MediaAssistant.DAL;
using MediaAssistant.DAL.Constants;

namespace MediaAssistant.Converters
{
    public class LibraryItemSearchTooltipConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is LibraryItem)
            {
                var libraryItem = (LibraryItem) value;
                switch (libraryItem.Type)
                {
                    case LibraryItemType.Actor:
                        return string.Format("Click here to show all movies acted by {0}", libraryItem.Title);
                    case LibraryItemType.Director:
                        return string.Format("Click here to show all movies directed by {0}", libraryItem.Title);
                    case LibraryItemType.MovieGenre:
                        return string.Format("Click here to show all movies of genre {0}", libraryItem.Title);
                    case LibraryItemType.Writer:
                        return string.Format("Click here to show all movies written by {0}", libraryItem.Title);
                    case LibraryItemType.Genre:
                        return string.Format("Click here to show all music of genre {0}", libraryItem.Title);
                    case LibraryItemType.Artist:
                        return string.Format("Click here to show all music sang by {0}", libraryItem.Title);
                    case LibraryItemType.Album:
                        return string.Format("Click here to show all music in album {0}", libraryItem.Title);
                    case LibraryItemType.Composer:
                        return string.Format("Click here to show all music composed by {0}", libraryItem.Title);
                    default:
                        return string.Format("Click here to show all item of {0}", libraryItem.Title);
                }
            }
            return string.Format("Click here to show all movies released in year {0}", value);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}